package com.ssy.lingxi.search.service;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.search.api.model.request.PurchaseCustomerRequest;
import com.ssy.lingxi.search.api.model.request.PurchaseRequest;
import com.ssy.lingxi.search.api.model.request.SimpleIdListRequest;
import com.ssy.lingxi.search.entity.Purchase;
import com.ssy.lingxi.search.model.response.PurchaseResponse;

import java.util.List;

/**
 * 进货单管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/22
 */
public interface IPurchaseService {
    /**
     * 查询进货单
     */
    List<PurchaseResponse> getPurchaseList(UserLoginCacheDTO sysUser, Long shopId, Boolean flag, Long customerMemberId, Long customerMemberRoleId, Long orderId);

    /**
     * 添加/修改进货单
     * @param purchase
     * @return
     */
    Integer saveOrUpdatePurchase(UserLoginCacheDTO sysUser, Purchase purchase);

    /**
     * 删除进货单
     * @param simpleIdListRequest
     * @return
     */
    String deletePurchase(SimpleIdListRequest simpleIdListRequest);

    /**
     * 查询进货单数量
     * @param sysUser
     * @return
     */
    Integer getPurchaseCount(UserLoginCacheDTO sysUser, Long shopId, Long customerMemberId, Long customerMemberRoleId, Long orderId);

    /**
     * 批量新增进货单
     * @return 是否成功
     */
    Boolean savePurchaseBatch(UserLoginCacheDTO sysUser, Long shopId, List<PurchaseRequest> purchaseBatchList);

    /**
     * 查询会员在商城的进货单里面商品的数量
     */
    Double getPurchaseCommodityCount(Long shopId, Long memberId, Long memberRoleId, Long commoditySkuId);

    /**
     * 代客下单批量新增进货单
     * @param sysUser
     * @param shopId
     * @param purchaseCustomerList
     * @return
     */
    Boolean savePurchaseCustomerBatch(UserLoginCacheDTO sysUser, Long shopId, List<PurchaseCustomerRequest> purchaseCustomerList);
}
